package com.siwei.mes.controller.common;

import com.siwei.mes.common.result.Json;
import com.siwei.mes.service.system.HomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

;

/**
 * 首页控制层
 *
 * @author yangke
 * @since 2023-11-30 15:45:00
 */
@Api(value = "首页接口")
@RestController
@RequestMapping("home")
public class HomeController {
    @Resource
    private HomeService homeService;

    @ApiOperation(value = "首页统计")
    @PostMapping("/homeAnalysis")
    public Json homeAnalysis(@RequestBody String data) {
        return Json.succ().data(homeService.homeAnalysis());
    }

    @ApiOperation(value = "试验分析")
    @PostMapping("/experimentAnalysis")
    public Json experimentAnalysis(@RequestBody String data) {
        return Json.succ().data(homeService.experimentAnalysis());
    }

    @ApiOperation(value = "工单分析")
    @PostMapping("/orderAnalysis")
    public Json orderAnalysis(@RequestBody String data) {
        return Json.succ().data(homeService.orderAnalysis());
    }

    @ApiOperation(value = "强度波动分析")
    @PostMapping("/intensityFluctuationsAnalysis")
    public Json intensityFluctuationsAnalysis(@RequestBody String data) {
        return Json.succ().data(homeService.intensityFluctuationsAnalysis());
    }

    @ApiOperation(value = "采购预估")
    @PostMapping("/purchaserPredict")
    public Json purchaserPredict(@RequestBody String data) {
        return Json.succ().data(homeService.purchaserPredict());
    }

    @ApiOperation(value = "工单趋势分析")
    @PostMapping("/orderTrendAnalysis")
    public Json orderTrendAnalysis(@RequestBody String data) {
        return Json.succ().data(homeService.orderTrendAnalysis());
    }

    @ApiOperation(value = "工单类型分析")
    @PostMapping("/workOrderTypeAnalysis")
    public Json workOrderTypeAnalysis(@RequestBody String data) {
        return Json.succ().data(homeService.workOrderTypeAnalysis());
    }
}
